package com.meisupic.copyright.domain.po;

import static javax.persistence.EnumType.STRING;

import com.meisupic.copyright.common.AuthorizeRuleEnum;
import com.meisupic.copyright.common.WorksProcessDetailEnum;
import com.meisupic.copyright.common.WorksProcessEnum;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.UpdateTimestamp;

/**
 * creation wuxun
 * @version V1.0
 * @Description: 版权登记作品对象
 * @date 2018/1/17 21:11
 */

@Data
@Entity
@Table(name = "copyright_works")
@DynamicUpdate
public class CopyRightWorks implements Serializable{

  @Id
  @GeneratedValue
  private Long id;

  @Column(name="goods_id")
  private Long goodsId;

  /**
   * 作品名称.
   */
  @Column(name = "works_full_name", length = 200, nullable = false)
  private String worksFullName;

  /**
   * 作品类型
   */
  @Column(name = "works_type", length = 20, nullable = false)
  private String worksType;

  /**
   * 作者
   */
  @Column(name = "author", length = 60, nullable = false)
  private String author;

  /**
   * 创作完成国家
   */
  @Column(name = "creation_country", length = 60, nullable = false)
  private String creationCountry;

  /**
   * 创作完成省份
   */
  @Column(name = "creation_province", length = 60, nullable = false)
  private String creationProvince;

  /**
   * 创作完成城市
   */
  @Column(name = "creation_city", length = 60, nullable = false)
  private String creationCity;

  /**
   * 创作日期
   */
  @Column(name = "creation_date", nullable = false)
  private Date creationDate;

  /**
   * 发表状态
   */
  @Column(name = "publish_status", length = 1, nullable = false)
  private Integer publishStatus;

  /**
   * 首次发表国家
   */
  @Column(name = "first_publish_country", length = 60)
  private String firstPublishCountry;

  /**
   * 首次发表省份
   */
  @Column(name = "first_publish_province", length = 60)
  private String firstPublishProvince;

  /**
   * 首次发表城市
   */
  @Column(name = "first_publish_city", length = 60)
  private String firstPublishCity;

  /**
   * 首次发表日期
   */
  @Column(name = "first_publish_date")
  private Date firstPublishDate;

  /**
   * 作品主要特点
   */
  @Column(name = "main_features", length = 1000, nullable = false)
  private String mainFeatures;

  /**
   * 权利归属方式
   */
  @Column(name = "right_own_mode", length = 1, nullable = false)
  private Integer rightOwnMode;

  /**
   * 权利取得方式
   */
  @Column(name = "right_fetch_mode", length = 1, nullable = false)
  private Integer rightFetchMode;

  /**
   * 创作性质
   */
  @Column(name = "creative_nature", length = 1, nullable = false)
  private Integer creativeNature;

  /**
   * 申请类型
   */
  @Column(name = "apply_type", length = 1, nullable = false)
  private Integer applyType;

  /**
   * 委托事项
   */
  @Column(name = "commitment", length = 400, nullable = false)
  private String commitment;

  /**
   * 分类id
   */
  @Column(name = "category_id", length = 10, nullable = false)
  private Integer categoryId;

  /**
   * 关键词.
   */
  @Column(name = "keywords", columnDefinition = "text",nullable = false)
  private String keywords;

  /**
   * 授权规则
   */
  @Column(name = "authorize_rule",length = 30,nullable = false)
  @Enumerated(value = EnumType.STRING)
  private AuthorizeRuleEnum authorizeRule;

  /**
   * 分成比例
   */
  @Column(name = "split_percentage", precision = 4, scale = 2, nullable = false)
  private BigDecimal splitPercentage;

  /**
   * 授权证书名称
   */
  @Column(name = "authorize_cert_image_name", length = 25)
  private String authorizeCertImageName;

  /**
   * 交易价格
   */
  @Column(name = "price")
  private Integer price;

  /**
   * 评分
   */
  @Column(name = "score")
  private Integer score;

  /**
   * 用途
   */
  @Column(name="uses" )
  private Integer uses;

  /**
   * 是否为系列作品
   */
  @Column(name = "series_of_works", nullable = false)
  private Boolean seriesOfWorks;

  /**
   * 是否为系列作品
   */
  @Column(name = "series_id")
  private String seriesId;

  /**
   * 图片地址
   */
  @Column(name = "image_name", nullable = false)
  private String imageName;

  /**
   * eps图片地址
   */
  @Column(name = "esp_image_name")
  private String epsImageName;

  /**
   * 创作声明文件地址
   */
  @Column(name = "creative_statement", nullable = false)
  private String creativeStatement;

  /**
   * 原创声明文件地址
   */
  @Column(name = "original_statement", nullable = false)
  private String originalStatement;

  /**
   * 合作创作声明文件地址
   */
  @Column(name = "cooperation_statement")
  private String cooperationStatement;

  /**
   * 法人创作声明文件地址
   */
  @Column(name = "legal_creation_statement")
  private String LegalCreationStatement;

  /**
   * 作品给版权保护中心的唯一标识符
   */
  @Column(name = "res_id")
  private String resId;

  /**
   * dci码
   */
  @Column(name = "dci_code",length = 50)
  private String dciCode;

  /**
   * dci信息查询地址
   */
  @Column(name = "dci_url",length = 200)
  private String dciUrl;

  /**
   * 证件文件名称
   */
  @Column(name = "cert_file_name",length = 100)
  private String certFileName;


  /**
   * 证书公布时间
   */
  @Column(name = "promulgate_date")
  private Date promulgateDate;

  /**
   * 原本区块链dna
   */
  @Column(name="dna")
  private String dna;

  /**
   * 申请人E签宝账户ID
   */
  @Column(name = "applicant_account_id", length = 50, nullable = false)
  private String applicantAccountId;

  /**
   * 版本号
   */
  @Column(name = "version", length = 3, nullable = false)
  @Version
  private Integer version;

  /**
   * 审核状态
   */
  @Column(name="works_process",length = 20,nullable = false)
  @Enumerated(value = STRING)
  private WorksProcessEnum worksProcess;

  /**
   * 审核详细状态
   */
  @Column(name="works_process_detail",length = 20,nullable = false)
  @Enumerated(value = STRING)
  private WorksProcessDetailEnum worksProcessDetail;

  /**
   * 创建人id
   */
  @Column(name = "creator_id", length = 10, nullable = false)
  private Long creatorId;

  /**
   * 创建用户实名认证名
   */
  @Column(name = "creator", length = 100, nullable = false)
  private String createor;

  /**
   * 创建时间
   */
  @Column(name = "create_time", nullable = false)
  @CreationTimestamp()
  private Date createTime;

  /**
   * 修改时间
   */
  @Column(name = "modify_time", nullable = false)
  @UpdateTimestamp
  private Date modifyTime;

  @Column(name = "huaban_image_url",length = 500)
  private String huabanImageUrl;

  @Column(name = "huaban_thumbnail_url", length = 500)
  private String huabanThumbnailUrl;

  /**
   * 人像授权证书地址
   */
  @Column(name = "auth_cert_file_url", length = 300)
  private String authCertFileUrl;

  @Column(name ="display",nullable = false)
  private Boolean display;

  @Column(name = "is_on_sale", length = 3)
  private Integer isOnSale;

  @Column(name="r_code")
  private String rCode;

  @Column(name = "certificate_url")
  private String certificateUrl;

  @Column(name = "sub_works_type")
  private Integer subWorksType;

  @Column(name = "r_code_status")
  private Integer rCodeStatus;

}
